package com.overlord.im.commons.message;

/**
 * @author wuwei
 * @className ProtocolConstant
 * @description
 * @date 2020/5/29 11:04
 **/
public interface ProtocolConstant {

    /**
     * 最大信息
     */
    int DATA_MAX_SIZE = 0x00FFFFFF;
    /**
     * overlord的头标记
     */
    byte OVERLORD_PACKET = (byte)(0x80);
    /**
     * 1000 (心跳)
     */
    byte OVERLORD_PACKET_HEART = OVERLORD_PACKET | 0x00;
    /**
     * 1001 (请求类型：client端向服务端发送的消息)
     */
    byte OVERLORD_PACKET_MSG_R = OVERLORD_PACKET | 0x10;
    /**
     * 1010 (请求类型：server端与client确认的消息即R的确认消息)
     */
    byte OVERLORD_PACKET_MSG_A = OVERLORD_PACKET | 0x20;
    /**
     * 1011 (请求类型：server端主动发起的消息)
     */
    byte OVERLORD_PACKET_MSG_N = OVERLORD_PACKET | 0x30;

    /**
     * overlord的协议头
     */

    /**
     * 1000 0001
     */
    byte VERSION_1 = (byte)(0x01);
    /**
     * 1001 0001
     */
    byte OVERLORD_MSG_R = VERSION_1 | OVERLORD_PACKET_MSG_R;
    /**
     * 1010 0001
     */
    byte OVERLORD_MSG_A = VERSION_1 | OVERLORD_PACKET_MSG_A;
    /**
     * 1011 0001
     */
    byte OVERLORD_MSG_N = VERSION_1 | OVERLORD_PACKET_MSG_N;
}
